package cam.School.Services;

import javax.ws.rs.POST;
import javax.ws.rs.Path;
import javax.ws.rs.PathParam;
import javax.ws.rs.Produces;
import javax.ws.rs.core.MediaType;

@Path("/autorisationService")
public class AutorisationService {
	//ServiceMethods:
//		 -addNewUser(data) (Only the admin or the principal can add a new user )
//		 -deleteUser(id)
//		 -setPrivilegeToUser(userId,privilegeState)
//		 -blockUser(id)
//		 -
//	
	
	@POST
	@Path("/addNewUser/{userData}")
	@Produces(MediaType.TEXT_XML)
	public boolean addNewUser(@PathParam("userData") String userData ) { 
		
//		userData ={
//				  "FirstName":"NewFirstName",
//				  "LastName":"NewLastName",
//				  "StreetNr":"NewStreetNr",
//				  "City":"NewCity",
//				  "ZipCode":"90567",
//				  "Country":"NewCountry",
//				  "Birthday":"10.10.1984",
//				  "Email":"newEmail@yahoo.de",
//				  "CellPhone":"00237998764526",
//				  "WorkPhone":"0023733457635",
//				  "IsPrincipalTeacher":"true",
//				  "Deleted:"false",
//				  "FirstRegistration:"10.11.2014",
//				  "LastUpdate:"10.11.2014",
//				  "MatriculationNumber:"NewMatriculationNumber",
//				  "PictureId":"234",
//				  "Profession:"English Teacher"
//		}
		return true; // or false falls es nicht gespeichert werden kann.		
	}
	
	
	@POST
	@Path("/deleteUser?id={id}")
	@Produces(MediaType.TEXT_XML)
	public boolean deleteUser(@PathParam("id") int id ) {				  
		
		return true; // or false falls es nicht gespeichert werden kann.		
	}		
	
	
	@POST
	@Path("/setPrivilegeToUser?id={id}&privilegeState={privilegeState}")
	@Produces(MediaType.TEXT_XML)
	public boolean setPrivilegeToUser(@PathParam("id") int id, @PathParam("privilegeState")String privilegeState ) {				  
		
		return true; // or false falls es nicht gespeichert werden kann.		
	}
		
	@POST
	@Path("/blockUser?id={id}")
	@Produces(MediaType.TEXT_XML)
	public boolean blockUser(@PathParam("id") int id ) {				  
		
		return true; // or false falls es nicht gespeichert werden kann.		
	}

}
